perftest: Fix ping-pong flag reset ordering#98
Open
Lyapunova-cd wants to merge 1 commit into
Open
Conversation
Complete each local flag reset before entering a global barrier. This prevents a slower PE from overwriting the peer's first signal after the timed kernel launches begin. Signed-off-by: hongwei.liu <hongwei.liu@mthreads.com> Co-authored-by: Cursor <cursoragent@cursor.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Complete each local flag reset before entering a global barrier. This prevents a slower PE from overwriting the peer's first signal after the timed kernel launches begin.
Summary
Why
The timed loop resets each PE's symmetric flag immediately before a
collective launch. Unlike the warmup path and the other ping-pong tests in
this directory, it did not synchronize the reset across PEs.
This permits the following ordering:
A device-side atomic signal store, volatile store, or fence cannot repair
this race because the missing happens-before relationship is between the
host-initiated reset on one PE and the kernel launch on another PE.
The issue was reproduced on a downstream CUDA-compatible backend. This
change mirrors the reset ordering already used by the warmup path and the
other symmetric-flag ping-pong tests.
Testing
shmem_p_ping_pong_latencyruns:Notes
The local device synchronization is needed to complete the local reset.
The following
nvshmem_barrier_all()is needed to establish cross-PEordering. Neither operation is included in the latency measurement.